new Vue({
    el:'#app',
    data:{
        law:{			//模态框显示的案件详情信息
            caseId:'',
            clientId:{
                cname:'',
            },
            oppositeId:{
                cname:'',
            },
            caseTime:'',
            locusStandi:'',
            causeOfAction:'',
            causeDetails:'',
            caseStatus:'',
            objectOfAction:'',
            caseTypeid:{
                typeName:''
            },
            recordFilename:'',
            submitId:{
                user_name:''
            },
            submitDate:'',
            mainLawyer:{
                empName:''
            },
            agencyMoney:'',
            blendMoney:'',
            amountMoney:'',
            courtId:{
                courtName:''
            },
            sessionDate:'',
            stateSessionDate:'',
            trialDate:'',
            closeState:'',
            closeMode:'',
            closeDate:'',
            closeDate:''
        },
        Case_audit:{
            caseid:{
                caseId:'',
                caseTime:''
            },
            auditid:{
                submitid:{
                    userId:''
                },
                remark:''
            }
        }
    },
    created(){
      this.init();  
    },
    methods:{
        init(){
            var caseid = localStorage.getItem("caseid");
            console.log(caseid);
            //得到选择的案件id
            this.$http.post("http://localhost:8080/law/queryByid",
                {"caseid":caseid},
                {emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")");
                this.law = msg.data;
            });
            this.Case_audit.caseid.caseId = caseid;
            var userid = $.cookie("redisId");
            this.Case_audit.auditid.submitid.userId = userid;
        },
        onSubmit() {
            //提交审核
            var data = JSON.stringify(this.Case_audit);
            this.$http.post("http://localhost:8080/Audit_closeLaw/closeLawStart",
                {"data":data},{emulateJSON: true}).then(result=>{
                var msg = eval("("+result.body+")");
                alert(msg.data);
                window.location.href="Case_init.html";
            })
        }
    }
})